#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<assert.h>
char* my_strncat(char* destination,const char* source,size_t num) {
	assert(destination&&source);
	char* p = destination;
	while (*destination) {
		destination++;
	}
	while (num) {
		*destination++ = *source++;
		if (*source == 0) {
			*destination = *source;
			break;
		}
		num--;
	}
	*destination = 0;
	return p;
}
int main()
{
	char arr1[20] = "hello ";
	char arr2[20] = "world!";
	int n = 1;
	//printf("%s\n", strncat(arr1, arr2, n));
	printf("%s\n", my_strncat(arr1, arr2, n));

	return 0;
}